#ifndef FITNESS_REAL_CU
#define FITNESS_REAL_CU

#include <math.h>

#include "fitnessBinaria.cuh"
#include "../utils/global.cuh"


float calcularFitnessRealCPU(float* poblacion, int posicion){
	float fitness = 0;
	float aux = 418.9829 * cantGenesEnCromosomaDevice;
	for(int i = 0; i < cantGenesEnCromosoma; i++){
	  fitness = fitness + poblacion[posicion + i] * sin(sqrt(fabs(poblacion[posicion + i])));
	}
	return aux - fitness;
}

__device__ float calcularFitnessRealGPU(float* poblacion, int posicion){
	float fitness = 0;
	float aux = 418.9829 * cantGenesEnCromosomaDevice;
	for(int i = 0; i < cantGenesEnCromosomaDevice; i++){
	  fitness = fitness + poblacion[posicion + i] * sin(sqrt(fabs(poblacion[posicion + i])));
	}
	return aux - fitness;
}


#endif

